package com.yoda.quartzdemo.job;

import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

@DisallowConcurrentExecution
public class HelloJob implements Job {
  
    private static Logger _log = LoggerFactory.getLogger(HelloJob.class);
     


    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
        //具体处理类组件名（处理类上加了@Component()注解，注意默认首字母数据库存的时候是小写）
        String name = jobDataMap.getString("name");


        _log.info("Hello Job执行时间: " + new Date()+"-----"+name+"---------"+context.getNextFireTime());
    }

}
